Conversation
|
mainに直マージでいいの? |
| } | ||
|
|
||
| func NewLoginCmdUsecase(http *gateway.HttpClient) *LoginCmdUsecase { | ||
| http.WithBaseURL("https://github.com/login") |
There was a problem hiding this comment.
これ、フィールドに直接代入するのではなくて、WithBaseURL()みたいなメソッドを経由しているのはなぜ?
もともとEndpointのフィールドとかはPublicで直接代入できるよね?
There was a problem hiding this comment.
このコードは使用方法が少し不適切なんだけど
メソッドチェーンを利用してるのは、WithBaseURL().WithBody().Excute("POST")みたいに
1行で書く量を減らせるから
|
|
||
| const ( | ||
| GithubClientID = "b27d87c28752d2363922" | ||
| GithubScope = "repo" |
There was a problem hiding this comment.
リポジトリの情報までスコープに入れる必要あるかな?公開されているパブリック情報だけでも、UIDとかは持ってこれる気もするけど
https://docs.github.com/ja/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes
There was a problem hiding this comment.
たしかに、scopeはもう少し限定してもいいかもね
There was a problem hiding this comment.
限定するというか、何も書かなければ最低限の情報しか取得しなくなるんじゃないかな。
There was a problem hiding this comment.
うんその認識だよ
(例)repo:〇〇で
pull requestを出すのに必要最低限のscopeにするってことだよね
There was a problem hiding this comment.
prが可能かどうかのscopeがパッとせんから一旦これはrepoでよろしく🙏
相談してなくてすまん |
| Client *http.Client | ||
| Endpoint string | ||
| Headers map[string]string | ||
| Params map[string]interface{} | ||
| Body io.Reader |
There was a problem hiding this comment.
メソッドチェーンでやるならここら辺プライベートでも良いかなと思ったけど、まあ時間ないならどちらでも
| Client *http.Client | |
| Endpoint string | |
| Headers map[string]string | |
| Params map[string]interface{} | |
| Body io.Reader | |
| Client *http.Client | |
| endpoint string | |
| headers map[string]string | |
| params map[string]interface{} | |
| body io.Reader |
|
@mochi-yu |
概要
デバイスフロー(参照)で、サーバーにアクセスせずにアクセストークンを発行して、configに保存するコマンド
(commitify login)を実装
補足